package model

import "gorm.io/gorm"

type BaseModel struct {
	Id        int64 `gorm:"primaryKey"`
	CreateAt  int64 `gorm:"column:create_at;"`
	UpdateAt  int64 `gorm:"column:update_at;"`
	DeleteAt  gorm.DeletedAt
	IsDeleted bool `gorm:"column:is_deleted;"`
}

type User struct {
	BaseModel
	UserId   int64  `gorm:"primaryKey,unique"`
	Birthday int64  `gorm:"birthday;"`
	Phone    string `gorm:"index:idx_phone;unique;type:varchar(11);not null"`
	Password string `gorm:"column:password;type:varchar(128);not null"`
	NickName string `gorm:"type:varchar(16)"`
	Gender   string `gorm:"column:gender;type:varchar(8)"`
	Role     uint32 `gorm:"column:role;default:1; comment '1表示普通用户，2表示管理员'"`
}
